package com.zhong.gang.applib.ui.adapter;

import android.text.TextUtils;
import android.view.View;
import android.widget.ImageView;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.zhong.gang.applib.utils.GlideUtils;
import com.zhong.gang.applib.R;

public class AddImgAdapter extends BaseQuickAdapter<String, BaseViewHolder> {
    public AddImgAdapter() {
        super(R.layout.item_add_img);
    }

    @Override
    protected void convert(BaseViewHolder helper, String item) {
        helper.addOnClickListener(R.id.add_layout);
        helper.addOnClickListener(R.id.image);
        helper.getView(R.id.add_layout).setVisibility(TextUtils.isEmpty(item)? View.VISIBLE:View.GONE);
        helper.getView(R.id.image).setVisibility(TextUtils.isEmpty(item)?View.GONE:View.VISIBLE);
        GlideUtils.show(mContext,item,(ImageView) helper.getView(R.id.image));
    }
}
